import { request } from '@/service/request'

export function getCodeApi() {
  return request({
    method: 'get',
    url: '/genVeriCode'
  })
}
export interface LoginDataState {
  phone: string
  veriCode: string
}

export function loginRegisterApi(data: LoginDataState) {
  return request({
    method: 'post',
    url: '/register',
    data: data
  })
}


export function uploadImage(file: File) {
  const formdata = new FormData();
  formdata.append('file', file, file.name)

  return request({
    url: '/utils/upload-img',
    method: 'post',
    data: formdata,
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    }
  })
}


export default { getCodeApi }
